package com.tte.common.designpattern.factory;

import com.tte.common.designpattern.service.Shopping;

/**
 * Factory
 */
public class Factory {
    public static void main(String[] args) {
        ShoppingFactory factory = new ShoppingFactory();

        //获取 Circle 的对象，并调用它的 draw 方法
        Shopping phone = factory.view("phone");
        phone.view();

        //获取 Rectangle 的对象，并调用它的 draw 方法
        Shopping foods = factory.view("foods");
        foods.view();

        //获取 Square 的对象，并调用它的 draw 方法
        Shopping commputer = factory.view("commputer");
        commputer.view();
    }


}
